package com.edu.controller;

import com.edu.dto.MessageDTO;
import com.edu.service.MymessageService;
import com.edu.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/message")
@CrossOrigin(origins = "http://localhost:5173", allowCredentials = "true")
public class MessageController {

    @Autowired
    private MymessageService mymessageService;

    @PostMapping("/send")
    public R sendMessage( MessageDTO messageDTO) {
        return mymessageService.sendMessage(messageDTO);
    }
}